<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
<h1>This is my first Ajax</h1>
<div id="response"></div>
<script >

    var xmlObj = new XMLHttpRequest();

    xmlObj.open("GET","http://localhost:63347/get?name=ajax");
    xmlObj.send();


    xmlObj.onload = function(){
        console.log(11111);
        console.log(xmlObj.readyState, xmlObj.status);
        if(xmlObj.readyState===4&&xmlObj.status===200){
            console.log(111);
            document.getElementById("response").innerHTML = xmlObj.responseText;
        }
    };



    console.log(xmlObj.responseText);


    /*
    *
    * xmlObj中，哪个属性是接收数据的
    * xmlObj.readyState与xmlObj.status处于别的状态时应该如何。错误处理？
     */

</script>
</body>
</html>